{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "a18b2d44",
   "metadata": {},
   "source": [
    "* 记录人：廖洪恩   \n",
    "* 记录时间：2022年4月19日   \n",
    "* 记录内容：地图API \n",
    "* 参考文档：https://zhuanlan.zhihu.com/p/97394628"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "6ee7fe27",
   "metadata": {},
   "source": [
    "# web服务简介\n",
    "* 高德Web服务API向开发者提供HTTP接口，开发者可通过这些接口使用各类型的地理数据服务，返回结果支持JSON和XML格式。Web服务API对所有用户开放。使用本组服务之前，需要申请应用Key。不同类型用户可获取不同的数据访问能力。"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "c2d7b1bd",
   "metadata": {},
   "source": [
    "# 地理/逆地理编码  \n",
    "* 结构化地址: \n",
    "> 首先，地址肯定是一串字符，内含国家、省份、城市、区县、城镇、乡村、街道、门牌号码、屋邨、大厦等建筑物名称。按照由大区域名称到小区域名称组合在一起的字符。一个有效的地址应该是独一无二的。注意：针对大陆、港、澳地区的地理编码转换时可以将国家信息选择性的忽略，但省、市、城镇等级别的地址构成是不能忽略的。暂时不支持返回台湾省的详细地址信息。  \n",
    "* 结构化地址<--->经纬度 \n",
    "> 地理编码/逆地理编码 API 是通过 HTTP/HTTPS 协议访问远程服务的接口，提供结构化地址与经纬度之间的相互转化的能力"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "9ea32121",
   "metadata": {},
   "source": [
    "## 地理编码"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "ab9ad363",
   "metadata": {},
   "outputs": [],
   "source": [
    "# 1、调用request模块（打开一个Google Chrome 浏览器）\n",
    "import requests"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "id": "716f9052",
   "metadata": {},
   "outputs": [],
   "source": [
    "# 1. 调用requests模块（google chrome 浏览器）\n",
    "import requests\n",
    "# 2. 请求方法 ： GET\n",
    "# 3. URL地址 ： https://restapi.amap.com/v3/geocode/geo?parameters\n",
    "geo_url = \"https://restapi.amap.com/v3/geocode/geo?parameters\"\n",
    "# 4. 准备参数，用于交换数据 payload\n",
    "payload = {\n",
    "    \"key\":\"35fbf70ba71f5acec6cb4fd2793b0e48\",\n",
    "    \"address\":\"广东省广州市从化区广州南方学院\"\n",
    "}\n",
    "# 5. 发起请求\n",
    "r = requests.get(url=geo_url, params=payload)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "id": "63561160",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<Response [200]>"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "r"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "id": "6287ceab",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'status': '1',\n",
       " 'info': 'OK',\n",
       " 'infocode': '10000',\n",
       " 'count': '1',\n",
       " 'geocodes': [{'formatted_address': '广东省广州市从化区温泉镇中心大学南方学院',\n",
       "   'country': '中国',\n",
       "   'province': '广东省',\n",
       "   'citycode': '020',\n",
       "   'city': '广州市',\n",
       "   'district': '从化区',\n",
       "   'township': [],\n",
       "   'neighborhood': {'name': [], 'type': []},\n",
       "   'building': {'name': [], 'type': []},\n",
       "   'adcode': '440117',\n",
       "   'street': [],\n",
       "   'number': [],\n",
       "   'location': '113.678280,23.628439',\n",
       "   'level': '兴趣点'}]}"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "r.json()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 44,
   "id": "a4589ec0",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'113.678280,23.628439'"
      ]
     },
     "execution_count": 44,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "广州南方学院_location = r.json()['geocodes'][0]['location']\n",
    "广州南方学院_location"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "40a334bd",
   "metadata": {},
   "source": [
    "## 逆地理编码"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "id": "db463ac2",
   "metadata": {},
   "outputs": [],
   "source": [
    "# 2、请求方法：GET\n",
    "# 3、请求逆地理编码URL地址：https://restapi.amap.com/v3/geocode/regeo?parameters\n",
    "regeo_url = \"https://restapi.amap.com/v3/geocode/regeo?parameters\"\n",
    "\n",
    "# 4、请求参数（payload）\n",
    "payload = {\n",
    "    \"key\":\"35fbf70ba71f5acec6cb4fd2793b0e48\",\n",
    "    \"location\":'113.678280,23.628439',\n",
    "    \"extensions\":\"all\", # 返回信息设置\n",
    "    \"poitype\":\"true\" # 开启搜索poi\n",
    "}\n",
    "\n",
    "# 5、发起请求\n",
    "r = requests.get(url=regeo_url, params=payload)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "id": "ea2c2547",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<Response [200]>"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "r"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "id": "00777def",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'status': '1',\n",
       " 'info': 'OK',\n",
       " 'infocode': '10000',\n",
       " 'regeocode': {'formatted_address': '广东省广州市从化区温泉镇博学路广州南方学院',\n",
       "  'addressComponent': {'country': '中国',\n",
       "   'province': '广东省',\n",
       "   'city': '广州市',\n",
       "   'citycode': '020',\n",
       "   'district': '从化区',\n",
       "   'adcode': '440117',\n",
       "   'township': '温泉镇',\n",
       "   'towncode': '440117100000',\n",
       "   'neighborhood': {'name': [], 'type': []},\n",
       "   'building': {'name': [], 'type': []},\n",
       "   'streetNumber': {'street': '博学路',\n",
       "    'number': '24号',\n",
       "    'location': '113.677267,23.629149',\n",
       "    'direction': '西北',\n",
       "    'distance': '129.943'},\n",
       "   'businessAreas': [[]]},\n",
       "  'pois': [{'id': 'B00140MR9A',\n",
       "    'name': '广州南方学院',\n",
       "    'type': '科教文化服务;学校;高等院校',\n",
       "    'tel': '020-87828988;020-61787331',\n",
       "    'direction': '北',\n",
       "    'distance': '470.792',\n",
       "    'location': '113.679257,23.632577',\n",
       "    'address': '温泉大道882号',\n",
       "    'poiweight': '0.450402',\n",
       "    'businessarea': []},\n",
       "   {'id': 'B0FFG4TAF2',\n",
       "    'name': '广州南方公寓',\n",
       "    'type': '商务住宅;商务住宅相关;商务住宅相关',\n",
       "    'tel': '13622768437',\n",
       "    'direction': '东南',\n",
       "    'distance': '102.617',\n",
       "    'location': '113.678983,23.627778',\n",
       "    'address': '温泉镇乌土村松浪队5号(近博学路)',\n",
       "    'poiweight': '0.237309',\n",
       "    'businessarea': []},\n",
       "   {'id': 'B0H6FA18J5',\n",
       "    'name': '保利半山花园',\n",
       "    'type': '商务住宅;住宅区;住宅区',\n",
       "    'tel': [],\n",
       "    'direction': '东南',\n",
       "    'distance': '139.054',\n",
       "    'location': '113.679358,23.627672',\n",
       "    'address': '从莞深高速(广州南方学院南侧)',\n",
       "    'poiweight': '0.223065',\n",
       "    'businessarea': []},\n",
       "   {'id': 'B00140TWHT',\n",
       "    'name': '教工住宅1号',\n",
       "    'type': '商务住宅;住宅区;住宅小区',\n",
       "    'tel': [],\n",
       "    'direction': '北',\n",
       "    'distance': '222.658',\n",
       "    'location': '113.678490,23.630432',\n",
       "    'address': '笃行路2',\n",
       "    'poiweight': '0.157653',\n",
       "    'businessarea': []},\n",
       "   {'id': 'B0FFHRJDM9',\n",
       "    'name': '中南公寓',\n",
       "    'type': '商务住宅;住宅区;住宅小区',\n",
       "    'tel': '13711245345',\n",
       "    'direction': '东南',\n",
       "    'distance': '231.223',\n",
       "    'location': '113.680340,23.627566',\n",
       "    'address': '中大南方学院南门1号',\n",
       "    'poiweight': '0.256152',\n",
       "    'businessarea': []},\n",
       "   {'id': 'B0HGD588HJ',\n",
       "    'name': '广州南方学院教学楼4号',\n",
       "    'type': '科教文化服务;学校;学校',\n",
       "    'tel': [],\n",
       "    'direction': '北',\n",
       "    'distance': '242.901',\n",
       "    'location': '113.677460,23.630490',\n",
       "    'address': '博学路',\n",
       "    'poiweight': '0.221662',\n",
       "    'businessarea': []},\n",
       "   {'id': 'B0FFHZH0IK',\n",
       "    'name': '地下铁',\n",
       "    'type': '餐饮服务;冷饮店;冷饮店',\n",
       "    'tel': [],\n",
       "    'direction': '西北',\n",
       "    'distance': '74.1376',\n",
       "    'location': '113.677941,23.629029',\n",
       "    'address': '博学路广州南方学院综合楼内',\n",
       "    'poiweight': '0.17934',\n",
       "    'businessarea': []},\n",
       "   {'id': 'B0HGDU76L2',\n",
       "    'name': '广州南方学院2号实验楼',\n",
       "    'type': '科教文化服务;学校;学校',\n",
       "    'tel': [],\n",
       "    'direction': '北',\n",
       "    'distance': '280.003',\n",
       "    'location': '113.678211,23.630956',\n",
       "    'address': '博学路',\n",
       "    'poiweight': '0.221662',\n",
       "    'businessarea': []},\n",
       "   {'id': 'B0FFKP838K',\n",
       "    'name': '教学楼3号(外国语学院)',\n",
       "    'type': '科教文化服务;学校;高等院校',\n",
       "    'tel': [],\n",
       "    'direction': '北',\n",
       "    'distance': '298.093',\n",
       "    'location': '113.677247,23.630947',\n",
       "    'address': '博学路25',\n",
       "    'poiweight': '0.191742',\n",
       "    'businessarea': []},\n",
       "   {'id': 'B0FFKSF1FI',\n",
       "    'name': '香辣螺蛳粉',\n",
       "    'type': '餐饮服务;餐饮相关场所;餐饮相关',\n",
       "    'tel': '17820061022',\n",
       "    'direction': '西',\n",
       "    'distance': '209.206',\n",
       "    'location': '113.676231,23.628565',\n",
       "    'address': '广州南方学院西4123',\n",
       "    'poiweight': '0.209252',\n",
       "    'businessarea': []},\n",
       "   {'id': 'B0HGDU8NLD',\n",
       "    'name': '广州南方学院1号实验楼',\n",
       "    'type': '科教文化服务;学校;学校',\n",
       "    'tel': [],\n",
       "    'direction': '北',\n",
       "    'distance': '326.007',\n",
       "    'location': '113.678215,23.631370',\n",
       "    'address': '博学路附近',\n",
       "    'poiweight': '0.221662',\n",
       "    'businessarea': []},\n",
       "   {'id': 'B0FFLF90I2',\n",
       "    'name': '煌上煌酱鸭(南方学院店)',\n",
       "    'type': '餐饮服务;快餐厅;快餐厅',\n",
       "    'tel': '13712317721',\n",
       "    'direction': '东北',\n",
       "    'distance': '256.772',\n",
       "    'location': '113.679965,23.630156',\n",
       "    'address': '笃行路20、22、24号广州南方学院商业中心1层1F015',\n",
       "    'poiweight': '0.209448',\n",
       "    'businessarea': []},\n",
       "   {'id': 'B0HGD58UTU',\n",
       "    'name': '广州南方学院2号教学楼',\n",
       "    'type': '科教文化服务;学校;学校',\n",
       "    'tel': [],\n",
       "    'direction': '西北',\n",
       "    'distance': '346.352',\n",
       "    'location': '113.677060,23.631346',\n",
       "    'address': '博学路',\n",
       "    'poiweight': '0.191229',\n",
       "    'businessarea': []},\n",
       "   {'id': 'B0H25SMRKP',\n",
       "    'name': '广州南方学院大礼堂',\n",
       "    'type': '科教文化服务;会展中心;会展中心',\n",
       "    'tel': [],\n",
       "    'direction': '东北',\n",
       "    'distance': '386.65',\n",
       "    'location': '113.680076,23.631502',\n",
       "    'address': '温泉大道882号',\n",
       "    'poiweight': '0.261624',\n",
       "    'businessarea': []},\n",
       "   {'id': 'B0HGDU92JD',\n",
       "    'name': '广州南方学院教学楼1号',\n",
       "    'type': '科教文化服务;学校;学校',\n",
       "    'tel': [],\n",
       "    'direction': '北',\n",
       "    'distance': '391.548',\n",
       "    'location': '113.677077,23.631783',\n",
       "    'address': '博学路19号',\n",
       "    'poiweight': '0.221662',\n",
       "    'businessarea': []},\n",
       "   {'id': 'B0HGD592BJ',\n",
       "    'name': '广州南方学院综合楼',\n",
       "    'type': '科教文化服务;学校;学校',\n",
       "    'tel': [],\n",
       "    'direction': '东北',\n",
       "    'distance': '392.731',\n",
       "    'location': '113.680117,23.631544',\n",
       "    'address': '温泉大道886号广州南方学院内',\n",
       "    'poiweight': '0.221662',\n",
       "    'businessarea': []},\n",
       "   {'id': 'B0FFKP81F0',\n",
       "    'name': '教学楼1号(文学与传媒学院)',\n",
       "    'type': '科教文化服务;科教文化场所;科教文化场所',\n",
       "    'tel': [],\n",
       "    'direction': '西北',\n",
       "    'distance': '393.93',\n",
       "    'location': '113.676866,23.631736',\n",
       "    'address': '博学路19号附近',\n",
       "    'poiweight': '0.191742',\n",
       "    'businessarea': []},\n",
       "   {'id': 'B0FFLBEOND',\n",
       "    'name': '聚贤楼10号',\n",
       "    'type': '商务住宅;住宅区;宿舍',\n",
       "    'tel': [],\n",
       "    'direction': '东北',\n",
       "    'distance': '418.51',\n",
       "    'location': '113.681253,23.631036',\n",
       "    'address': '从莞深高速(广州南方学院)',\n",
       "    'poiweight': '0.190963',\n",
       "    'businessarea': []},\n",
       "   {'id': 'B0FFH6K3U9',\n",
       "    'name': '广州中大南方招待所',\n",
       "    'type': '住宿服务;住宿服务相关;住宿服务相关',\n",
       "    'tel': '020-61787222',\n",
       "    'direction': '西北',\n",
       "    'distance': '378.102',\n",
       "    'location': '113.676330,23.631332',\n",
       "    'address': '温泉镇温泉大道882号广州南方学院H7栋1-5层',\n",
       "    'poiweight': '0.254885',\n",
       "    'businessarea': []},\n",
       "   {'id': 'B0HGD58NF8',\n",
       "    'name': '广州南方学院达人书院',\n",
       "    'type': '科教文化服务;科教文化场所;科教文化场所',\n",
       "    'tel': [],\n",
       "    'direction': '北',\n",
       "    'distance': '446.366',\n",
       "    'location': '113.679041,23.632392',\n",
       "    'address': '温泉大道882号广州南方学院新综合楼2层',\n",
       "    'poiweight': '0.191229',\n",
       "    'businessarea': []},\n",
       "   {'id': 'B0FFKUVYWV',\n",
       "    'name': '广州和风庭阿七度假别墅',\n",
       "    'type': '住宿服务;住宿服务相关;住宿服务相关',\n",
       "    'tel': [],\n",
       "    'direction': '东北',\n",
       "    'distance': '424.35',\n",
       "    'location': '113.681736,23.630569',\n",
       "    'address': '保利桃花源',\n",
       "    'poiweight': '0.273168',\n",
       "    'businessarea': []},\n",
       "   {'id': 'B0HGDU99RM',\n",
       "    'name': '广州南方学院图书馆',\n",
       "    'type': '科教文化服务;图书馆;图书馆',\n",
       "    'tel': '020-61787368;020-61787371',\n",
       "    'direction': '北',\n",
       "    'distance': '489.331',\n",
       "    'location': '113.679177,23.632762',\n",
       "    'address': '温泉大道882号广州南方学院内',\n",
       "    'poiweight': '0.257947',\n",
       "    'businessarea': []},\n",
       "   {'id': 'B0HGDU92JC',\n",
       "    'name': '广州南方学院4号实验楼',\n",
       "    'type': '科教文化服务;学校;学校',\n",
       "    'tel': [],\n",
       "    'direction': '北',\n",
       "    'distance': '498.883',\n",
       "    'location': '113.679963,23.632652',\n",
       "    'address': '博学路附近',\n",
       "    'poiweight': '0.221662',\n",
       "    'businessarea': []},\n",
       "   {'id': 'B0FFL7C054',\n",
       "    'name': '广州U优森特酒店',\n",
       "    'type': '住宿服务;住宿服务相关;住宿服务相关',\n",
       "    'tel': '15813395296',\n",
       "    'direction': '北',\n",
       "    'distance': '464.819',\n",
       "    'location': '113.679226,23.632528',\n",
       "    'address': '温泉镇博学路882号(广州南方学院商业中心1层)',\n",
       "    'poiweight': '0.317505',\n",
       "    'businessarea': []},\n",
       "   {'id': 'B0FFG8CSEK',\n",
       "    'name': 'L5员工宿舍',\n",
       "    'type': '商务住宅;住宅区;宿舍',\n",
       "    'tel': [],\n",
       "    'direction': '东北',\n",
       "    'distance': '554.129',\n",
       "    'location': '113.682583,23.631487',\n",
       "    'address': '从莞深高速(广州南方学院)',\n",
       "    'poiweight': '0.185371',\n",
       "    'businessarea': []},\n",
       "   {'id': 'B0HGD58FR2',\n",
       "    'name': '广州南方学院教学楼9号',\n",
       "    'type': '科教文化服务;学校;学校',\n",
       "    'tel': [],\n",
       "    'direction': '北',\n",
       "    'distance': '532.163',\n",
       "    'location': '113.679747,23.633032',\n",
       "    'address': '广州南方学院',\n",
       "    'poiweight': '0.221662',\n",
       "    'businessarea': []},\n",
       "   {'id': 'B0HG5Z9JNK',\n",
       "    'name': '广州南方学院教学楼7号',\n",
       "    'type': '科教文化服务;学校;学校',\n",
       "    'tel': [],\n",
       "    'direction': '北',\n",
       "    'distance': '544.868',\n",
       "    'location': '113.678600,23.633330',\n",
       "    'address': '博学路',\n",
       "    'poiweight': '0.221553',\n",
       "    'businessarea': []},\n",
       "   {'id': 'B0HGD599JM',\n",
       "    'name': '广州南方学院第11教学楼',\n",
       "    'type': '科教文化服务;学校;学校',\n",
       "    'tel': [],\n",
       "    'direction': '北',\n",
       "    'distance': '556.036',\n",
       "    'location': '113.680037,23.633173',\n",
       "    'address': '温泉大道882号广州南方学院',\n",
       "    'poiweight': '0.221662',\n",
       "    'businessarea': []},\n",
       "   {'id': 'B0GUJYPEG2',\n",
       "    'name': '怒烤烤串(从化店)',\n",
       "    'type': '餐饮服务;中餐厅;特色/地方风味餐厅',\n",
       "    'tel': [],\n",
       "    'direction': '北',\n",
       "    'distance': '510.112',\n",
       "    'location': '113.677160,23.632910',\n",
       "    'address': '温泉大道882号广州南方学院内博学路6号之3',\n",
       "    'poiweight': '0.216026',\n",
       "    'businessarea': []},\n",
       "   {'id': 'B0HGDU6Z41',\n",
       "    'name': '广州南方学院教学楼6号',\n",
       "    'type': '科教文化服务;学校;学校',\n",
       "    'tel': [],\n",
       "    'direction': '北',\n",
       "    'distance': '586.331',\n",
       "    'location': '113.678424,23.633710',\n",
       "    'address': '温泉大道882',\n",
       "    'poiweight': '0.221662',\n",
       "    'businessarea': []}],\n",
       "  'roads': [{'id': '020F49F0050461206',\n",
       "    'name': '博学路',\n",
       "    'direction': '北',\n",
       "    'distance': '7.63232',\n",
       "    'location': '113.678,23.6284'},\n",
       "   {'id': '020F49F0050462229',\n",
       "    'name': '老虎形街',\n",
       "    'direction': '北',\n",
       "    'distance': '445.159',\n",
       "    'location': '113.679,23.6245'},\n",
       "   {'id': '020F49F0050462451',\n",
       "    'name': '中山路',\n",
       "    'direction': '南',\n",
       "    'distance': '708.299',\n",
       "    'location': '113.677,23.6347'}],\n",
       "  'roadinters': [{'direction': '南',\n",
       "    'distance': '708.299',\n",
       "    'location': '113.676794,23.634661',\n",
       "    'first_id': '020F49F0050461206',\n",
       "    'first_name': '博学路',\n",
       "    'second_id': '020F49F0050462451',\n",
       "    'second_name': '中山路'}],\n",
       "  'aois': [{'id': 'B00140MR9A',\n",
       "    'name': '广州南方学院',\n",
       "    'adcode': '440117',\n",
       "    'location': '113.679257,23.632577',\n",
       "    'area': '528560.656426',\n",
       "    'distance': '0',\n",
       "    'type': '141201'}]}}"
      ]
     },
     "execution_count": 14,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "r.json()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "id": "560e607d",
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas as pd"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "id": "d53cd386",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>id</th>\n",
       "      <th>name</th>\n",
       "      <th>type</th>\n",
       "      <th>tel</th>\n",
       "      <th>direction</th>\n",
       "      <th>distance</th>\n",
       "      <th>location</th>\n",
       "      <th>address</th>\n",
       "      <th>poiweight</th>\n",
       "      <th>businessarea</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>B00140MR9A</td>\n",
       "      <td>广州南方学院</td>\n",
       "      <td>科教文化服务;学校;高等院校</td>\n",
       "      <td>020-87828988;020-61787331</td>\n",
       "      <td>北</td>\n",
       "      <td>470.792</td>\n",
       "      <td>113.679257,23.632577</td>\n",
       "      <td>温泉大道882号</td>\n",
       "      <td>0.450402</td>\n",
       "      <td>[]</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>B0FFG4TAF2</td>\n",
       "      <td>广州南方公寓</td>\n",
       "      <td>商务住宅;商务住宅相关;商务住宅相关</td>\n",
       "      <td>13622768437</td>\n",
       "      <td>东南</td>\n",
       "      <td>102.617</td>\n",
       "      <td>113.678983,23.627778</td>\n",
       "      <td>温泉镇乌土村松浪队5号(近博学路)</td>\n",
       "      <td>0.237309</td>\n",
       "      <td>[]</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>B0H6FA18J5</td>\n",
       "      <td>保利半山花园</td>\n",
       "      <td>商务住宅;住宅区;住宅区</td>\n",
       "      <td>[]</td>\n",
       "      <td>东南</td>\n",
       "      <td>139.054</td>\n",
       "      <td>113.679358,23.627672</td>\n",
       "      <td>从莞深高速(广州南方学院南侧)</td>\n",
       "      <td>0.223065</td>\n",
       "      <td>[]</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>B00140TWHT</td>\n",
       "      <td>教工住宅1号</td>\n",
       "      <td>商务住宅;住宅区;住宅小区</td>\n",
       "      <td>[]</td>\n",
       "      <td>北</td>\n",
       "      <td>222.658</td>\n",
       "      <td>113.678490,23.630432</td>\n",
       "      <td>笃行路2</td>\n",
       "      <td>0.157653</td>\n",
       "      <td>[]</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>B0FFHRJDM9</td>\n",
       "      <td>中南公寓</td>\n",
       "      <td>商务住宅;住宅区;住宅小区</td>\n",
       "      <td>13711245345</td>\n",
       "      <td>东南</td>\n",
       "      <td>231.223</td>\n",
       "      <td>113.680340,23.627566</td>\n",
       "      <td>中大南方学院南门1号</td>\n",
       "      <td>0.256152</td>\n",
       "      <td>[]</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>B0HGD588HJ</td>\n",
       "      <td>广州南方学院教学楼4号</td>\n",
       "      <td>科教文化服务;学校;学校</td>\n",
       "      <td>[]</td>\n",
       "      <td>北</td>\n",
       "      <td>242.901</td>\n",
       "      <td>113.677460,23.630490</td>\n",
       "      <td>博学路</td>\n",
       "      <td>0.221662</td>\n",
       "      <td>[]</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>B0FFHZH0IK</td>\n",
       "      <td>地下铁</td>\n",
       "      <td>餐饮服务;冷饮店;冷饮店</td>\n",
       "      <td>[]</td>\n",
       "      <td>西北</td>\n",
       "      <td>74.1376</td>\n",
       "      <td>113.677941,23.629029</td>\n",
       "      <td>博学路广州南方学院综合楼内</td>\n",
       "      <td>0.17934</td>\n",
       "      <td>[]</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>B0HGDU76L2</td>\n",
       "      <td>广州南方学院2号实验楼</td>\n",
       "      <td>科教文化服务;学校;学校</td>\n",
       "      <td>[]</td>\n",
       "      <td>北</td>\n",
       "      <td>280.003</td>\n",
       "      <td>113.678211,23.630956</td>\n",
       "      <td>博学路</td>\n",
       "      <td>0.221662</td>\n",
       "      <td>[]</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>B0FFKP838K</td>\n",
       "      <td>教学楼3号(外国语学院)</td>\n",
       "      <td>科教文化服务;学校;高等院校</td>\n",
       "      <td>[]</td>\n",
       "      <td>北</td>\n",
       "      <td>298.093</td>\n",
       "      <td>113.677247,23.630947</td>\n",
       "      <td>博学路25</td>\n",
       "      <td>0.191742</td>\n",
       "      <td>[]</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>B0FFKSF1FI</td>\n",
       "      <td>香辣螺蛳粉</td>\n",
       "      <td>餐饮服务;餐饮相关场所;餐饮相关</td>\n",
       "      <td>17820061022</td>\n",
       "      <td>西</td>\n",
       "      <td>209.206</td>\n",
       "      <td>113.676231,23.628565</td>\n",
       "      <td>广州南方学院西4123</td>\n",
       "      <td>0.209252</td>\n",
       "      <td>[]</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>B0HGDU8NLD</td>\n",
       "      <td>广州南方学院1号实验楼</td>\n",
       "      <td>科教文化服务;学校;学校</td>\n",
       "      <td>[]</td>\n",
       "      <td>北</td>\n",
       "      <td>326.007</td>\n",
       "      <td>113.678215,23.631370</td>\n",
       "      <td>博学路附近</td>\n",
       "      <td>0.221662</td>\n",
       "      <td>[]</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>B0FFLF90I2</td>\n",
       "      <td>煌上煌酱鸭(南方学院店)</td>\n",
       "      <td>餐饮服务;快餐厅;快餐厅</td>\n",
       "      <td>13712317721</td>\n",
       "      <td>东北</td>\n",
       "      <td>256.772</td>\n",
       "      <td>113.679965,23.630156</td>\n",
       "      <td>笃行路20、22、24号广州南方学院商业中心1层1F015</td>\n",
       "      <td>0.209448</td>\n",
       "      <td>[]</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>B0HGD58UTU</td>\n",
       "      <td>广州南方学院2号教学楼</td>\n",
       "      <td>科教文化服务;学校;学校</td>\n",
       "      <td>[]</td>\n",
       "      <td>西北</td>\n",
       "      <td>346.352</td>\n",
       "      <td>113.677060,23.631346</td>\n",
       "      <td>博学路</td>\n",
       "      <td>0.191229</td>\n",
       "      <td>[]</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>B0H25SMRKP</td>\n",
       "      <td>广州南方学院大礼堂</td>\n",
       "      <td>科教文化服务;会展中心;会展中心</td>\n",
       "      <td>[]</td>\n",
       "      <td>东北</td>\n",
       "      <td>386.65</td>\n",
       "      <td>113.680076,23.631502</td>\n",
       "      <td>温泉大道882号</td>\n",
       "      <td>0.261624</td>\n",
       "      <td>[]</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>B0HGDU92JD</td>\n",
       "      <td>广州南方学院教学楼1号</td>\n",
       "      <td>科教文化服务;学校;学校</td>\n",
       "      <td>[]</td>\n",
       "      <td>北</td>\n",
       "      <td>391.548</td>\n",
       "      <td>113.677077,23.631783</td>\n",
       "      <td>博学路19号</td>\n",
       "      <td>0.221662</td>\n",
       "      <td>[]</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>B0HGD592BJ</td>\n",
       "      <td>广州南方学院综合楼</td>\n",
       "      <td>科教文化服务;学校;学校</td>\n",
       "      <td>[]</td>\n",
       "      <td>东北</td>\n",
       "      <td>392.731</td>\n",
       "      <td>113.680117,23.631544</td>\n",
       "      <td>温泉大道886号广州南方学院内</td>\n",
       "      <td>0.221662</td>\n",
       "      <td>[]</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>16</th>\n",
       "      <td>B0FFKP81F0</td>\n",
       "      <td>教学楼1号(文学与传媒学院)</td>\n",
       "      <td>科教文化服务;科教文化场所;科教文化场所</td>\n",
       "      <td>[]</td>\n",
       "      <td>西北</td>\n",
       "      <td>393.93</td>\n",
       "      <td>113.676866,23.631736</td>\n",
       "      <td>博学路19号附近</td>\n",
       "      <td>0.191742</td>\n",
       "      <td>[]</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>17</th>\n",
       "      <td>B0FFLBEOND</td>\n",
       "      <td>聚贤楼10号</td>\n",
       "      <td>商务住宅;住宅区;宿舍</td>\n",
       "      <td>[]</td>\n",
       "      <td>东北</td>\n",
       "      <td>418.51</td>\n",
       "      <td>113.681253,23.631036</td>\n",
       "      <td>从莞深高速(广州南方学院)</td>\n",
       "      <td>0.190963</td>\n",
       "      <td>[]</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>18</th>\n",
       "      <td>B0FFH6K3U9</td>\n",
       "      <td>广州中大南方招待所</td>\n",
       "      <td>住宿服务;住宿服务相关;住宿服务相关</td>\n",
       "      <td>020-61787222</td>\n",
       "      <td>西北</td>\n",
       "      <td>378.102</td>\n",
       "      <td>113.676330,23.631332</td>\n",
       "      <td>温泉镇温泉大道882号广州南方学院H7栋1-5层</td>\n",
       "      <td>0.254885</td>\n",
       "      <td>[]</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>19</th>\n",
       "      <td>B0HGD58NF8</td>\n",
       "      <td>广州南方学院达人书院</td>\n",
       "      <td>科教文化服务;科教文化场所;科教文化场所</td>\n",
       "      <td>[]</td>\n",
       "      <td>北</td>\n",
       "      <td>446.366</td>\n",
       "      <td>113.679041,23.632392</td>\n",
       "      <td>温泉大道882号广州南方学院新综合楼2层</td>\n",
       "      <td>0.191229</td>\n",
       "      <td>[]</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20</th>\n",
       "      <td>B0FFKUVYWV</td>\n",
       "      <td>广州和风庭阿七度假别墅</td>\n",
       "      <td>住宿服务;住宿服务相关;住宿服务相关</td>\n",
       "      <td>[]</td>\n",
       "      <td>东北</td>\n",
       "      <td>424.35</td>\n",
       "      <td>113.681736,23.630569</td>\n",
       "      <td>保利桃花源</td>\n",
       "      <td>0.273168</td>\n",
       "      <td>[]</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>21</th>\n",
       "      <td>B0HGDU99RM</td>\n",
       "      <td>广州南方学院图书馆</td>\n",
       "      <td>科教文化服务;图书馆;图书馆</td>\n",
       "      <td>020-61787368;020-61787371</td>\n",
       "      <td>北</td>\n",
       "      <td>489.331</td>\n",
       "      <td>113.679177,23.632762</td>\n",
       "      <td>温泉大道882号广州南方学院内</td>\n",
       "      <td>0.257947</td>\n",
       "      <td>[]</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>22</th>\n",
       "      <td>B0HGDU92JC</td>\n",
       "      <td>广州南方学院4号实验楼</td>\n",
       "      <td>科教文化服务;学校;学校</td>\n",
       "      <td>[]</td>\n",
       "      <td>北</td>\n",
       "      <td>498.883</td>\n",
       "      <td>113.679963,23.632652</td>\n",
       "      <td>博学路附近</td>\n",
       "      <td>0.221662</td>\n",
       "      <td>[]</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>23</th>\n",
       "      <td>B0FFL7C054</td>\n",
       "      <td>广州U优森特酒店</td>\n",
       "      <td>住宿服务;住宿服务相关;住宿服务相关</td>\n",
       "      <td>15813395296</td>\n",
       "      <td>北</td>\n",
       "      <td>464.819</td>\n",
       "      <td>113.679226,23.632528</td>\n",
       "      <td>温泉镇博学路882号(广州南方学院商业中心1层)</td>\n",
       "      <td>0.317505</td>\n",
       "      <td>[]</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24</th>\n",
       "      <td>B0FFG8CSEK</td>\n",
       "      <td>L5员工宿舍</td>\n",
       "      <td>商务住宅;住宅区;宿舍</td>\n",
       "      <td>[]</td>\n",
       "      <td>东北</td>\n",
       "      <td>554.129</td>\n",
       "      <td>113.682583,23.631487</td>\n",
       "      <td>从莞深高速(广州南方学院)</td>\n",
       "      <td>0.185371</td>\n",
       "      <td>[]</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25</th>\n",
       "      <td>B0HGD58FR2</td>\n",
       "      <td>广州南方学院教学楼9号</td>\n",
       "      <td>科教文化服务;学校;学校</td>\n",
       "      <td>[]</td>\n",
       "      <td>北</td>\n",
       "      <td>532.163</td>\n",
       "      <td>113.679747,23.633032</td>\n",
       "      <td>广州南方学院</td>\n",
       "      <td>0.221662</td>\n",
       "      <td>[]</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>26</th>\n",
       "      <td>B0HG5Z9JNK</td>\n",
       "      <td>广州南方学院教学楼7号</td>\n",
       "      <td>科教文化服务;学校;学校</td>\n",
       "      <td>[]</td>\n",
       "      <td>北</td>\n",
       "      <td>544.868</td>\n",
       "      <td>113.678600,23.633330</td>\n",
       "      <td>博学路</td>\n",
       "      <td>0.221553</td>\n",
       "      <td>[]</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>27</th>\n",
       "      <td>B0HGD599JM</td>\n",
       "      <td>广州南方学院第11教学楼</td>\n",
       "      <td>科教文化服务;学校;学校</td>\n",
       "      <td>[]</td>\n",
       "      <td>北</td>\n",
       "      <td>556.036</td>\n",
       "      <td>113.680037,23.633173</td>\n",
       "      <td>温泉大道882号广州南方学院</td>\n",
       "      <td>0.221662</td>\n",
       "      <td>[]</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>28</th>\n",
       "      <td>B0GUJYPEG2</td>\n",
       "      <td>怒烤烤串(从化店)</td>\n",
       "      <td>餐饮服务;中餐厅;特色/地方风味餐厅</td>\n",
       "      <td>[]</td>\n",
       "      <td>北</td>\n",
       "      <td>510.112</td>\n",
       "      <td>113.677160,23.632910</td>\n",
       "      <td>温泉大道882号广州南方学院内博学路6号之3</td>\n",
       "      <td>0.216026</td>\n",
       "      <td>[]</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>29</th>\n",
       "      <td>B0HGDU6Z41</td>\n",
       "      <td>广州南方学院教学楼6号</td>\n",
       "      <td>科教文化服务;学校;学校</td>\n",
       "      <td>[]</td>\n",
       "      <td>北</td>\n",
       "      <td>586.331</td>\n",
       "      <td>113.678424,23.633710</td>\n",
       "      <td>温泉大道882</td>\n",
       "      <td>0.221662</td>\n",
       "      <td>[]</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "            id            name                  type  \\\n",
       "0   B00140MR9A          广州南方学院        科教文化服务;学校;高等院校   \n",
       "1   B0FFG4TAF2          广州南方公寓    商务住宅;商务住宅相关;商务住宅相关   \n",
       "2   B0H6FA18J5          保利半山花园          商务住宅;住宅区;住宅区   \n",
       "3   B00140TWHT          教工住宅1号         商务住宅;住宅区;住宅小区   \n",
       "4   B0FFHRJDM9            中南公寓         商务住宅;住宅区;住宅小区   \n",
       "5   B0HGD588HJ     广州南方学院教学楼4号          科教文化服务;学校;学校   \n",
       "6   B0FFHZH0IK             地下铁          餐饮服务;冷饮店;冷饮店   \n",
       "7   B0HGDU76L2     广州南方学院2号实验楼          科教文化服务;学校;学校   \n",
       "8   B0FFKP838K    教学楼3号(外国语学院)        科教文化服务;学校;高等院校   \n",
       "9   B0FFKSF1FI           香辣螺蛳粉      餐饮服务;餐饮相关场所;餐饮相关   \n",
       "10  B0HGDU8NLD     广州南方学院1号实验楼          科教文化服务;学校;学校   \n",
       "11  B0FFLF90I2    煌上煌酱鸭(南方学院店)          餐饮服务;快餐厅;快餐厅   \n",
       "12  B0HGD58UTU     广州南方学院2号教学楼          科教文化服务;学校;学校   \n",
       "13  B0H25SMRKP       广州南方学院大礼堂      科教文化服务;会展中心;会展中心   \n",
       "14  B0HGDU92JD     广州南方学院教学楼1号          科教文化服务;学校;学校   \n",
       "15  B0HGD592BJ       广州南方学院综合楼          科教文化服务;学校;学校   \n",
       "16  B0FFKP81F0  教学楼1号(文学与传媒学院)  科教文化服务;科教文化场所;科教文化场所   \n",
       "17  B0FFLBEOND          聚贤楼10号           商务住宅;住宅区;宿舍   \n",
       "18  B0FFH6K3U9       广州中大南方招待所    住宿服务;住宿服务相关;住宿服务相关   \n",
       "19  B0HGD58NF8      广州南方学院达人书院  科教文化服务;科教文化场所;科教文化场所   \n",
       "20  B0FFKUVYWV     广州和风庭阿七度假别墅    住宿服务;住宿服务相关;住宿服务相关   \n",
       "21  B0HGDU99RM       广州南方学院图书馆        科教文化服务;图书馆;图书馆   \n",
       "22  B0HGDU92JC     广州南方学院4号实验楼          科教文化服务;学校;学校   \n",
       "23  B0FFL7C054        广州U优森特酒店    住宿服务;住宿服务相关;住宿服务相关   \n",
       "24  B0FFG8CSEK          L5员工宿舍           商务住宅;住宅区;宿舍   \n",
       "25  B0HGD58FR2     广州南方学院教学楼9号          科教文化服务;学校;学校   \n",
       "26  B0HG5Z9JNK     广州南方学院教学楼7号          科教文化服务;学校;学校   \n",
       "27  B0HGD599JM    广州南方学院第11教学楼          科教文化服务;学校;学校   \n",
       "28  B0GUJYPEG2       怒烤烤串(从化店)    餐饮服务;中餐厅;特色/地方风味餐厅   \n",
       "29  B0HGDU6Z41     广州南方学院教学楼6号          科教文化服务;学校;学校   \n",
       "\n",
       "                          tel direction distance              location  \\\n",
       "0   020-87828988;020-61787331         北  470.792  113.679257,23.632577   \n",
       "1                 13622768437        东南  102.617  113.678983,23.627778   \n",
       "2                          []        东南  139.054  113.679358,23.627672   \n",
       "3                          []         北  222.658  113.678490,23.630432   \n",
       "4                 13711245345        东南  231.223  113.680340,23.627566   \n",
       "5                          []         北  242.901  113.677460,23.630490   \n",
       "6                          []        西北  74.1376  113.677941,23.629029   \n",
       "7                          []         北  280.003  113.678211,23.630956   \n",
       "8                          []         北  298.093  113.677247,23.630947   \n",
       "9                 17820061022         西  209.206  113.676231,23.628565   \n",
       "10                         []         北  326.007  113.678215,23.631370   \n",
       "11                13712317721        东北  256.772  113.679965,23.630156   \n",
       "12                         []        西北  346.352  113.677060,23.631346   \n",
       "13                         []        东北   386.65  113.680076,23.631502   \n",
       "14                         []         北  391.548  113.677077,23.631783   \n",
       "15                         []        东北  392.731  113.680117,23.631544   \n",
       "16                         []        西北   393.93  113.676866,23.631736   \n",
       "17                         []        东北   418.51  113.681253,23.631036   \n",
       "18               020-61787222        西北  378.102  113.676330,23.631332   \n",
       "19                         []         北  446.366  113.679041,23.632392   \n",
       "20                         []        东北   424.35  113.681736,23.630569   \n",
       "21  020-61787368;020-61787371         北  489.331  113.679177,23.632762   \n",
       "22                         []         北  498.883  113.679963,23.632652   \n",
       "23                15813395296         北  464.819  113.679226,23.632528   \n",
       "24                         []        东北  554.129  113.682583,23.631487   \n",
       "25                         []         北  532.163  113.679747,23.633032   \n",
       "26                         []         北  544.868  113.678600,23.633330   \n",
       "27                         []         北  556.036  113.680037,23.633173   \n",
       "28                         []         北  510.112  113.677160,23.632910   \n",
       "29                         []         北  586.331  113.678424,23.633710   \n",
       "\n",
       "                          address poiweight businessarea  \n",
       "0                        温泉大道882号  0.450402           []  \n",
       "1               温泉镇乌土村松浪队5号(近博学路)  0.237309           []  \n",
       "2                 从莞深高速(广州南方学院南侧)  0.223065           []  \n",
       "3                            笃行路2  0.157653           []  \n",
       "4                      中大南方学院南门1号  0.256152           []  \n",
       "5                             博学路  0.221662           []  \n",
       "6                   博学路广州南方学院综合楼内   0.17934           []  \n",
       "7                             博学路  0.221662           []  \n",
       "8                           博学路25  0.191742           []  \n",
       "9                     广州南方学院西4123  0.209252           []  \n",
       "10                          博学路附近  0.221662           []  \n",
       "11  笃行路20、22、24号广州南方学院商业中心1层1F015  0.209448           []  \n",
       "12                            博学路  0.191229           []  \n",
       "13                       温泉大道882号  0.261624           []  \n",
       "14                         博学路19号  0.221662           []  \n",
       "15                温泉大道886号广州南方学院内  0.221662           []  \n",
       "16                       博学路19号附近  0.191742           []  \n",
       "17                  从莞深高速(广州南方学院)  0.190963           []  \n",
       "18       温泉镇温泉大道882号广州南方学院H7栋1-5层  0.254885           []  \n",
       "19           温泉大道882号广州南方学院新综合楼2层  0.191229           []  \n",
       "20                          保利桃花源  0.273168           []  \n",
       "21                温泉大道882号广州南方学院内  0.257947           []  \n",
       "22                          博学路附近  0.221662           []  \n",
       "23       温泉镇博学路882号(广州南方学院商业中心1层)  0.317505           []  \n",
       "24                  从莞深高速(广州南方学院)  0.185371           []  \n",
       "25                         广州南方学院  0.221662           []  \n",
       "26                            博学路  0.221553           []  \n",
       "27                 温泉大道882号广州南方学院  0.221662           []  \n",
       "28         温泉大道882号广州南方学院内博学路6号之3  0.216026           []  \n",
       "29                        温泉大道882  0.221662           []  "
      ]
     },
     "execution_count": 16,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "pd.json_normalize(r.json()['regeocode']['pois'])"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "000adee3",
   "metadata": {},
   "source": [
    "* 记录人：廖洪恩   \n",
    "* 记录时间：2022年4月25日  周一 \n",
    "* 记录内容：API中的POI2.0 \n",
    "* 参考文档：https://lbs.amap.com/api/webservice/guide/api/search/"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "624829c9",
   "metadata": {},
   "source": [
    "## 作业"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "31acfb47",
   "metadata": {},
   "source": [
    "### 关键字搜索"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 101,
   "id": "6a98dfbd",
   "metadata": {},
   "outputs": [],
   "source": [
    "# 1. 调用requests模块（google chrome 浏览器）\n",
    "import requests\n",
    "# 2. 请求方法 ： GET\n",
    "# 3. URL地址 ： https://restapi.amap.com/v5/place/text?parameters\n",
    "geo_url = \"https://restapi.amap.com/v5/place/text?parameters\"\n",
    "# 4. 准备参数，用于交换数据 payload\n",
    "payload = {\n",
    "    \"key\":\"08f4e6968c4c15e35b4c6e7151f3c814\",\n",
    "    \"keywords\":\"广东省广州市从化区中餐厅|广东省广州市从化区西餐厅|广东省广州市从化区快餐厅\"\n",
    "}\n",
    "# 5. 发起请求\n",
    "r = requests.get(url=geo_url, params=payload)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 102,
   "id": "54e6745e",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<Response [200]>"
      ]
     },
     "execution_count": 102,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "r"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 103,
   "id": "a6634231",
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'status': '1',\n",
       " 'info': 'OK',\n",
       " 'infocode': '10000',\n",
       " 'pois': [{'name': '快餐厅',\n",
       "   'id': 'B0H0OKUBTQ',\n",
       "   'location': '113.487441,23.582770',\n",
       "   'type': '餐饮服务;快餐厅;快餐厅',\n",
       "   'typecode': '050300',\n",
       "   'pname': '广东省',\n",
       "   'cityname': '广州市',\n",
       "   'adname': '从化区',\n",
       "   'address': '鳌头镇城鳌大道东路1383号(鑫广隆旁边)',\n",
       "   'pcode': '440000',\n",
       "   'citycode': '020',\n",
       "   'adcode': '440117'},\n",
       "  {'name': '景泰快餐厅',\n",
       "   'id': 'B0H0XU373K',\n",
       "   'location': '113.617497,23.559770',\n",
       "   'type': '餐饮服务;快餐厅;快餐厅',\n",
       "   'typecode': '050300',\n",
       "   'pname': '广东省',\n",
       "   'cityname': '广州市',\n",
       "   'adname': '从化区',\n",
       "   'address': '环市东路维也纳酒店(江埔店)西侧约80米',\n",
       "   'pcode': '440000',\n",
       "   'citycode': '020',\n",
       "   'adcode': '440117'},\n",
       "  {'name': '水蒸快餐厅',\n",
       "   'id': 'B0FFLAGDOD',\n",
       "   'location': '113.487361,23.582871',\n",
       "   'type': '餐饮服务;快餐厅;快餐厅',\n",
       "   'typecode': '050300',\n",
       "   'pname': '广东省',\n",
       "   'cityname': '广州市',\n",
       "   'adname': '从化区',\n",
       "   'address': '城鳌大道东与棋杆小坑大围街交叉路口往东南约150米',\n",
       "   'pcode': '440000',\n",
       "   'citycode': '020',\n",
       "   'adcode': '440117'},\n",
       "  {'name': '法式西餐厅',\n",
       "   'id': 'B0IGKRLOH6',\n",
       "   'location': '113.567074,23.503333',\n",
       "   'type': '餐饮服务;外国餐厅;西餐厅(综合风味)',\n",
       "   'typecode': '050201',\n",
       "   'pname': '广东省',\n",
       "   'cityname': '广州市',\n",
       "   'adname': '从化区',\n",
       "   'address': '碧海路与碧海六径交叉口东480米',\n",
       "   'pcode': '440000',\n",
       "   'citycode': '020',\n",
       "   'adcode': '440117'},\n",
       "  {'name': '广州市从化区城郊加润美食店',\n",
       "   'id': 'B0G3LAGKIT',\n",
       "   'location': '113.579519,23.554631',\n",
       "   'type': '餐饮服务;中餐厅;广东菜(粤菜)',\n",
       "   'typecode': '050103',\n",
       "   'pname': '广东省',\n",
       "   'cityname': '广州市',\n",
       "   'adname': '从化区',\n",
       "   'address': '城郊街新城西路101号',\n",
       "   'pcode': '440000',\n",
       "   'citycode': '020',\n",
       "   'adcode': '440117'},\n",
       "  {'name': '广州市从化温泉泉韵餐厅',\n",
       "   'id': 'B0FFL0VX2A',\n",
       "   'location': '113.647625,23.619287',\n",
       "   'type': '餐饮服务;中餐厅;中餐厅',\n",
       "   'typecode': '050100',\n",
       "   'pname': '广东省',\n",
       "   'cityname': '广州市',\n",
       "   'adname': '从化区',\n",
       "   'address': '温泉镇龙泉路5号',\n",
       "   'pcode': '440000',\n",
       "   'citycode': '020',\n",
       "   'adcode': '440117'},\n",
       "  {'name': '尚悦西餐厅',\n",
       "   'id': 'B0IGSU48XX',\n",
       "   'location': '113.591447,23.544403',\n",
       "   'type': '餐饮服务;外国餐厅;西餐厅(综合风味)',\n",
       "   'typecode': '050201',\n",
       "   'pname': '广东省',\n",
       "   'cityname': '广州市',\n",
       "   'adname': '从化区',\n",
       "   'address': '河滨南路与中田东路交叉口北20米',\n",
       "   'pcode': '440000',\n",
       "   'citycode': '020',\n",
       "   'adcode': '440117'},\n",
       "  {'name': '品爵西餐厅',\n",
       "   'id': 'B0HRMSIB3H',\n",
       "   'location': '113.590299,23.546525',\n",
       "   'type': '餐饮服务;外国餐厅;西餐厅(综合风味)',\n",
       "   'typecode': '050201',\n",
       "   'pname': '广东省',\n",
       "   'cityname': '广州市',\n",
       "   'adname': '从化区',\n",
       "   'address': '新城东路与新城东路二巷交叉口西北60米',\n",
       "   'pcode': '440000',\n",
       "   'citycode': '020',\n",
       "   'adcode': '440117'},\n",
       "  {'name': '回味鸡快餐厅(龙潭大道店)',\n",
       "   'id': 'B0GKA51GIO',\n",
       "   'location': '113.413258,23.712181',\n",
       "   'type': '餐饮服务;快餐厅;快餐厅',\n",
       "   'typecode': '050300',\n",
       "   'pname': '广东省',\n",
       "   'cityname': '广州市',\n",
       "   'adname': '从化区',\n",
       "   'address': '龙潭大道与西向围街交叉路口往北约140米',\n",
       "   'pcode': '440000',\n",
       "   'citycode': '020',\n",
       "   'adcode': '440117'},\n",
       "  {'name': '回味鸡快餐厅(太平分店)',\n",
       "   'id': 'B00141JAZL',\n",
       "   'location': '113.496654,23.460560',\n",
       "   'type': '餐饮服务;快餐厅;快餐厅',\n",
       "   'typecode': '050300',\n",
       "   'pname': '广东省',\n",
       "   'cityname': '广州市',\n",
       "   'adname': '从化区',\n",
       "   'address': '一零五国道水南小学附近',\n",
       "   'pcode': '440000',\n",
       "   'citycode': '020',\n",
       "   'adcode': '440117'}],\n",
       " 'count': '10'}"
      ]
     },
     "execution_count": 103,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "r.json()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 104,
   "id": "86bc6644",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'113.487441,23.582770'"
      ]
     },
     "execution_count": 104,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "广州市从化区_location = r.json()['pois'][0]['location']\n",
    "广州市从化区_location"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "923ca306",
   "metadata": {},
   "source": [
    "### 周边搜索"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 105,
   "id": "d816a630",
   "metadata": {},
   "outputs": [],
   "source": [
    "# 1. 调用requests模块（google chrome 浏览器）\n",
    "import requests\n",
    "# 2. 请求方法 ： GET\n",
    "# 3. URL地址 ：https://restapi.amap.com/v5/place/around?parameters\n",
    "geo_url = \"https://restapi.amap.com/v5/place/around?parameters\"\n",
    "# 4. 准备参数，用于交换数据 payload\n",
    "payload = {\n",
    "    \"key\":\"08f4e6968c4c15e35b4c6e7151f3c814\",\n",
    "    \"location\":\"113.487441,23.582770\"\n",
    "}\n",
    "# 5. 发起请求\n",
    "r = requests.get(url=geo_url, params=payload)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 106,
   "id": "3ae316fc",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<Response [200]>"
      ]
     },
     "execution_count": 106,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "r"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 107,
   "id": "0015431b",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'status': '1',\n",
       " 'info': 'OK',\n",
       " 'infocode': '10000',\n",
       " 'pois': [{'name': '快餐厅',\n",
       "   'id': 'B0H0OKUBTQ',\n",
       "   'location': '113.487441,23.582770',\n",
       "   'type': '餐饮服务;快餐厅;快餐厅',\n",
       "   'typecode': '050300',\n",
       "   'pname': '广东省',\n",
       "   'cityname': '广州市',\n",
       "   'adname': '从化区',\n",
       "   'address': '鳌头镇城鳌大道东路1383号(鑫广隆旁边)',\n",
       "   'pcode': '440000',\n",
       "   'citycode': '020',\n",
       "   'adcode': '440117'},\n",
       "  {'name': '水蒸快餐厅',\n",
       "   'id': 'B0FFLAGDOD',\n",
       "   'location': '113.487361,23.582871',\n",
       "   'type': '餐饮服务;快餐厅;快餐厅',\n",
       "   'typecode': '050300',\n",
       "   'pname': '广东省',\n",
       "   'cityname': '广州市',\n",
       "   'adname': '从化区',\n",
       "   'address': '城鳌大道东与棋杆小坑大围街交叉路口往东南约150米',\n",
       "   'pcode': '440000',\n",
       "   'citycode': '020',\n",
       "   'adcode': '440117'},\n",
       "  {'name': '罗浩早餐店',\n",
       "   'id': 'B0FFI768XW',\n",
       "   'location': '113.487674,23.582813',\n",
       "   'type': '餐饮服务;中餐厅;中餐厅',\n",
       "   'typecode': '050100',\n",
       "   'pname': '广东省',\n",
       "   'cityname': '广州市',\n",
       "   'adname': '从化区',\n",
       "   'address': '鳌头镇棋杆万宝对面广隆隔壁',\n",
       "   'pcode': '440000',\n",
       "   'citycode': '020',\n",
       "   'adcode': '440117'},\n",
       "  {'name': '海陆丰专业搭棚搭架',\n",
       "   'id': 'B0GK567BU5',\n",
       "   'location': '113.488573,23.582643',\n",
       "   'type': '生活服务;生活服务场所;生活服务场所',\n",
       "   'typecode': '070000',\n",
       "   'pname': '广东省',\n",
       "   'cityname': '广州市',\n",
       "   'adname': '从化区',\n",
       "   'address': '城鳌大道东与棋杆小坑大围街交叉路口往东约250米',\n",
       "   'pcode': '440000',\n",
       "   'citycode': '020',\n",
       "   'adcode': '440117'},\n",
       "  {'name': '高价废品店',\n",
       "   'id': 'B0H2J5UDXR',\n",
       "   'location': '113.488702,23.582529',\n",
       "   'type': '生活服务;生活服务场所;生活服务场所',\n",
       "   'typecode': '070000',\n",
       "   'pname': '广东省',\n",
       "   'cityname': '广州市',\n",
       "   'adname': '从化区',\n",
       "   'address': '城鳌大道东与大氹社岗一街交叉口西340米',\n",
       "   'pcode': '440000',\n",
       "   'citycode': '020',\n",
       "   'adcode': '440117'},\n",
       "  {'name': '广州鸿天发模架工程有限公司',\n",
       "   'id': 'B0G1V5B7C2',\n",
       "   'location': '113.488773,23.582510',\n",
       "   'type': '生活服务;生活服务场所;生活服务场所',\n",
       "   'typecode': '070000',\n",
       "   'pname': '广东省',\n",
       "   'cityname': '广州市',\n",
       "   'adname': '从化区',\n",
       "   'address': '城鳌大道东与大氹社岗一街交叉口西340米',\n",
       "   'pcode': '440000',\n",
       "   'citycode': '020',\n",
       "   'adcode': '440117'},\n",
       "  {'name': '清湛私房菜馆',\n",
       "   'id': 'B0H33PNZS0',\n",
       "   'location': '113.489136,23.582409',\n",
       "   'type': '餐饮服务;中餐厅;中餐厅',\n",
       "   'typecode': '050100',\n",
       "   'pname': '广东省',\n",
       "   'cityname': '广州市',\n",
       "   'adname': '从化区',\n",
       "   'address': '城鳌大道东',\n",
       "   'pcode': '440000',\n",
       "   'citycode': '020',\n",
       "   'adcode': '440117'},\n",
       "  {'name': '权兴白铁环保设备工程',\n",
       "   'id': 'B0GK5P985N',\n",
       "   'location': '113.489425,23.582380',\n",
       "   'type': '生活服务;生活服务场所;生活服务场所',\n",
       "   'typecode': '070000',\n",
       "   'pname': '广东省',\n",
       "   'cityname': '广州市',\n",
       "   'adname': '从化区',\n",
       "   'address': '城鳌大道东路1335',\n",
       "   'pcode': '440000',\n",
       "   'citycode': '020',\n",
       "   'adcode': '440117'},\n",
       "  {'name': '炜联机械加工',\n",
       "   'id': 'B0FFL6DF1G',\n",
       "   'location': '113.489507,23.582478',\n",
       "   'type': '生活服务;生活服务场所;生活服务场所',\n",
       "   'typecode': '070000',\n",
       "   'pname': '广东省',\n",
       "   'cityname': '广州市',\n",
       "   'adname': '从化区',\n",
       "   'address': '鳌头镇城鳌大道万宝冰箱西门对面',\n",
       "   'pcode': '440000',\n",
       "   'citycode': '020',\n",
       "   'adcode': '440117'},\n",
       "  {'name': '聚能超声',\n",
       "   'id': 'B0G3HZ4A7X',\n",
       "   'location': '113.489744,23.582434',\n",
       "   'type': '生活服务;维修站点;维修站点',\n",
       "   'typecode': '071200',\n",
       "   'pname': '广东省',\n",
       "   'cityname': '广州市',\n",
       "   'adname': '从化区',\n",
       "   'address': '城鳌大道东1323号',\n",
       "   'pcode': '440000',\n",
       "   'citycode': '020',\n",
       "   'adcode': '440117'}],\n",
       " 'count': '10'}"
      ]
     },
     "execution_count": 107,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "r.json()"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "bd6c1979",
   "metadata": {},
   "source": [
    "### 多边形区域搜索"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "9d285010",
   "metadata": {},
   "outputs": [],
   "source": [
    "# 1. 调用requests模块（google chrome 浏览器）\n",
    "import requests\n",
    "# 2. 请求方法 ： GET\n",
    "# 3. URL地址 ：https://restapi.amap.com/v5/place/polygon?parameters\n",
    "geo_url = \"https://restapi.amap.com/v5/place/polygon?parameters\"\n",
    "# 4. 准备参数，用于交换数据 payload\n",
    "payload = {\n",
    "    \"key\":\"08f4e6968c4c15e35b4c6e7151f3c814\",\n",
    "    \"polygon\":\"116.460988,40.006919|116.48231,40.007381;116.47516,39.99713|116.472596,39.985227|116.45669,39.984989|116.460988,40.006919\"\n",
    "}\n",
    "# 5. 发起请求\n",
    "r = requests.get(url=geo_url, params=payload)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "89107b61",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<Response [200]>"
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "r"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "3c652204",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'status': '1',\n",
       " 'info': 'OK',\n",
       " 'infocode': '10000',\n",
       " 'pois': [{'name': '望京(地铁站)',\n",
       "   'id': 'BV10013356',\n",
       "   'location': '116.469409,39.998521',\n",
       "   'type': '交通设施服务;地铁站;地铁站',\n",
       "   'typecode': '150500',\n",
       "   'pname': '北京市',\n",
       "   'cityname': '北京市',\n",
       "   'adname': '朝阳区',\n",
       "   'address': '14号线;15号线',\n",
       "   'pcode': '110000',\n",
       "   'citycode': '010',\n",
       "   'adcode': '110105'},\n",
       "  {'name': '阜通(地铁站)',\n",
       "   'id': 'BV10416592',\n",
       "   'location': '116.471740,39.991699',\n",
       "   'type': '交通设施服务;地铁站;地铁站',\n",
       "   'typecode': '150500',\n",
       "   'pname': '北京市',\n",
       "   'cityname': '北京市',\n",
       "   'adname': '朝阳区',\n",
       "   'address': '14号线',\n",
       "   'pcode': '110000',\n",
       "   'citycode': '010',\n",
       "   'adcode': '110105'},\n",
       "  {'name': '望京南湖东园二区',\n",
       "   'id': 'B000A7W44I',\n",
       "   'location': '116.465513,39.999783',\n",
       "   'type': '商务住宅;住宅区;住宅小区',\n",
       "   'typecode': '120302',\n",
       "   'pname': '北京市',\n",
       "   'cityname': '北京市',\n",
       "   'adname': '朝阳区',\n",
       "   'address': '望京街道办事处',\n",
       "   'pcode': '110000',\n",
       "   'citycode': '010',\n",
       "   'adcode': '110105'},\n",
       "  {'name': '望京西园',\n",
       "   'id': 'B000A844UJ',\n",
       "   'location': '116.474395,40.004173',\n",
       "   'type': '商务住宅;住宅区;住宅小区',\n",
       "   'typecode': '120302',\n",
       "   'pname': '北京市',\n",
       "   'cityname': '北京市',\n",
       "   'adname': '朝阳区',\n",
       "   'address': '宏昌路附近',\n",
       "   'pcode': '110000',\n",
       "   'citycode': '010',\n",
       "   'adcode': '110105'},\n",
       "  {'name': '大西洋新城',\n",
       "   'id': 'B000A7HA7I',\n",
       "   'location': '116.465778,39.991918',\n",
       "   'type': '商务住宅;住宅区;住宅小区',\n",
       "   'typecode': '120302',\n",
       "   'pname': '北京市',\n",
       "   'cityname': '北京市',\n",
       "   'adname': '朝阳区',\n",
       "   'address': '望京广顺北大街33号(阜通地铁站A1西北口步行300米)',\n",
       "   'pcode': '110000',\n",
       "   'citycode': '010',\n",
       "   'adcode': '110105'},\n",
       "  {'name': '金隅国际',\n",
       "   'id': 'B000A868CO',\n",
       "   'location': '116.458365,39.985906',\n",
       "   'type': '商务住宅;楼宇;商住两用楼宇',\n",
       "   'typecode': '120203',\n",
       "   'pname': '北京市',\n",
       "   'cityname': '北京市',\n",
       "   'adname': '朝阳区',\n",
       "   'address': '望京西路48-4号',\n",
       "   'pcode': '110000',\n",
       "   'citycode': '010',\n",
       "   'adcode': '110105'},\n",
       "  {'name': '花家地西里一区',\n",
       "   'id': 'B000A80FW6',\n",
       "   'location': '116.460129,39.988222',\n",
       "   'type': '商务住宅;住宅区;住宅小区',\n",
       "   'typecode': '120302',\n",
       "   'pname': '北京市',\n",
       "   'cityname': '北京市',\n",
       "   'adname': '朝阳区',\n",
       "   'address': '阜通西大街',\n",
       "   'pcode': '110000',\n",
       "   'citycode': '010',\n",
       "   'adcode': '110105'},\n",
       "  {'name': '花家地北里',\n",
       "   'id': 'B000A7HS1R',\n",
       "   'location': '116.465861,39.986147',\n",
       "   'type': '商务住宅;住宅区;住宅小区',\n",
       "   'typecode': '120302',\n",
       "   'pname': '北京市',\n",
       "   'cityname': '北京市',\n",
       "   'adname': '朝阳区',\n",
       "   'address': '花家地南街',\n",
       "   'pcode': '110000',\n",
       "   'citycode': '010',\n",
       "   'adcode': '110105'},\n",
       "  {'name': '福码大厦',\n",
       "   'id': 'B000A80FUH',\n",
       "   'location': '116.467422,39.994876',\n",
       "   'type': '商务住宅;楼宇;商务写字楼',\n",
       "   'typecode': '120201',\n",
       "   'pname': '北京市',\n",
       "   'cityname': '北京市',\n",
       "   'adname': '朝阳区',\n",
       "   'address': '广顺北大街33号院1号楼',\n",
       "   'pcode': '110000',\n",
       "   'citycode': '010',\n",
       "   'adcode': '110105'},\n",
       "  {'name': '花家地西里',\n",
       "   'id': 'B000A7HS3L',\n",
       "   'location': '116.460327,39.988763',\n",
       "   'type': '商务住宅;住宅区;住宅小区',\n",
       "   'typecode': '120302',\n",
       "   'pname': '北京市',\n",
       "   'cityname': '北京市',\n",
       "   'adname': '朝阳区',\n",
       "   'address': '南湖南路',\n",
       "   'pcode': '110000',\n",
       "   'citycode': '010',\n",
       "   'adcode': '110105'}],\n",
       " 'count': '10'}"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "r.json()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "41325b52",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "markdown",
   "id": "8dc14b77",
   "metadata": {},
   "source": [
    "### ID搜索"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 112,
   "id": "71e814a9",
   "metadata": {},
   "outputs": [],
   "source": [
    "# 1. 调用requests模块（google chrome 浏览器）\n",
    "import requests\n",
    "# 2. 请求方法 ： GET\n",
    "# 3. URL地址 ：https://restapi.amap.com/v5/place/detail?parameters\n",
    "id_url = \"https://restapi.amap.com/v5/place/detail?parameters\"\n",
    "# 4. 准备参数，用于交换数据 payload\n",
    "payload = {\n",
    "    \"key\":\"08f4e6968c4c15e35b4c6e7151f3c814\",\n",
    "    \"id\":\"B0H0OKUBTQ|B0FFLAGDOD|B0H33PNZS0|B0FFL6DF1G|B0GK5P985N\"\n",
    "}\n",
    "# 5. 发起请求\n",
    "r = requests.get(url=id_url, params=payload)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 113,
   "id": "42e34c6e",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<Response [200]>"
      ]
     },
     "execution_count": 113,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "r"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 114,
   "id": "c21ecaf7",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'status': '1',\n",
       " 'info': 'OK',\n",
       " 'infocode': '10000',\n",
       " 'pois': [{'name': '快餐厅',\n",
       "   'id': 'B0H0OKUBTQ',\n",
       "   'location': '113.487441,23.582770',\n",
       "   'type': '餐饮服务;快餐厅;快餐厅',\n",
       "   'typecode': '050300',\n",
       "   'pname': '广东省',\n",
       "   'cityname': '广州市',\n",
       "   'adname': '从化区',\n",
       "   'address': '鳌头镇城鳌大道东路1383号(鑫广隆旁边)',\n",
       "   'pcode': '440000',\n",
       "   'citycode': '020',\n",
       "   'adcode': '440117'},\n",
       "  {'name': '水蒸快餐厅',\n",
       "   'id': 'B0FFLAGDOD',\n",
       "   'location': '113.487361,23.582871',\n",
       "   'type': '餐饮服务;快餐厅;快餐厅',\n",
       "   'typecode': '050300',\n",
       "   'pname': '广东省',\n",
       "   'cityname': '广州市',\n",
       "   'adname': '从化区',\n",
       "   'address': '城鳌大道东与棋杆小坑大围街交叉路口往东南约150米',\n",
       "   'pcode': '440000',\n",
       "   'citycode': '020',\n",
       "   'adcode': '440117'},\n",
       "  {'name': '清湛私房菜馆',\n",
       "   'id': 'B0H33PNZS0',\n",
       "   'location': '113.489136,23.582409',\n",
       "   'type': '餐饮服务;中餐厅;中餐厅',\n",
       "   'typecode': '050100',\n",
       "   'pname': '广东省',\n",
       "   'cityname': '广州市',\n",
       "   'adname': '从化区',\n",
       "   'address': '城鳌大道东',\n",
       "   'pcode': '440000',\n",
       "   'citycode': '020',\n",
       "   'adcode': '440117'},\n",
       "  {'name': '炜联机械加工',\n",
       "   'id': 'B0FFL6DF1G',\n",
       "   'location': '113.489507,23.582478',\n",
       "   'type': '生活服务;生活服务场所;生活服务场所',\n",
       "   'typecode': '070000',\n",
       "   'pname': '广东省',\n",
       "   'cityname': '广州市',\n",
       "   'adname': '从化区',\n",
       "   'address': '鳌头镇城鳌大道万宝冰箱西门对面',\n",
       "   'pcode': '440000',\n",
       "   'citycode': '020',\n",
       "   'adcode': '440117'},\n",
       "  {'name': '权兴白铁环保设备工程',\n",
       "   'id': 'B0GK5P985N',\n",
       "   'location': '113.489425,23.582380',\n",
       "   'type': '生活服务;生活服务场所;生活服务场所',\n",
       "   'typecode': '070000',\n",
       "   'pname': '广东省',\n",
       "   'cityname': '广州市',\n",
       "   'adname': '从化区',\n",
       "   'address': '城鳌大道东路1335',\n",
       "   'pcode': '440000',\n",
       "   'citycode': '020',\n",
       "   'adcode': '440117'}],\n",
       " 'count': '5'}"
      ]
     },
     "execution_count": 114,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "r.json()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "9ba0dddc",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.8"
  },
  "toc": {
   "base_numbering": 1,
   "nav_menu": {},
   "number_sections": true,
   "sideBar": true,
   "skip_h1_title": false,
   "title_cell": "Table of Contents",
   "title_sidebar": "Contents",
   "toc_cell": false,
   "toc_position": {},
   "toc_section_display": true,
   "toc_window_display": false
  },
  "varInspector": {
   "cols": {
    "lenName": 16,
    "lenType": 16,
    "lenVar": 40
   },
   "kernels_config": {
    "python": {
     "delete_cmd_postfix": "",
     "delete_cmd_prefix": "del ",
     "library": "var_list.py",
     "varRefreshCmd": "print(var_dic_list())"
    },
    "r": {
     "delete_cmd_postfix": ") ",
     "delete_cmd_prefix": "rm(",
     "library": "var_list.r",
     "varRefreshCmd": "cat(var_dic_list()) "
    }
   },
   "types_to_exclude": [
    "module",
    "function",
    "builtin_function_or_method",
    "instance",
    "_Feature"
   ],
   "window_display": false
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
